/*
  封装搜索相关的接口
*/
import $axios from '@/utils/request'

/**
 * @description: 获取搜索联想
 * @param {*}
 * @return {*}
 */
export const getSuggestion = keyword => {
  return $axios({
    method: 'GET',
    url: '/v1_0/suggestion',
    params: {
      q: keyword
    }
  })
}

/**
 * @description: 获取搜索结果
 * @param {*} q：搜索关键字， page: 页数
 * @return {*}
 */
export const searchResult = (q, page) => {
  return $axios({
    method: 'GET',
    url: '/v1_0/search',
    params: {
      q,
      page
    }
  })
}
